package d1113.r21118.nw;

import java.util.Arrays;
import java.util.Scanner;

public class Demo01 {
    public int[] sum(int[] nums, int ret) {
        for(int i = 0;i< nums.length;i++){
            for(int j = i+1;j<nums.length;++j){
                if(i!=j && nums[i] + nums[j] ==ret){
                    return new int []{i,j};
                }
            }
        }
        return new int[0];
    }

    public static void main(String[] args) {
        Demo01 d1 = new Demo01();
        Scanner sc = new Scanner(System.in);
        int [] a = {3,6,9,10,5,7,8,4};
        int ret = sc.nextInt();
        int [] b = d1.sum(a,ret);
        System.out.println("数组：[3,6,9,10,5,7,8,4]\n"+"输入："+ret+"\n"+"结果是："+Arrays.toString(b));

    }
}
